package com.kgc.ljp.entity;

import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.Date;

public class Flight implements Serializable{
    private String aNo;//编号
    private String fCity;//起飞城市
    private String dCity;//降落城市
    private Date time;//日期
    private double price;//价格
    private double disCount;//折扣

    /**
     * 无参构造
     */
    public Flight() {
    }

    public String getaNo() {
        return aNo;
    }

    public void setaNo(String aNo) {
        this.aNo = aNo;
    }

    public String getfCity() {
        return fCity;
    }

    public void setfCity(String fCity) {
        this.fCity = fCity;
    }

    public String getdCity() {
        return dCity;
    }

    public void setdCity(String dCity) {
        this.dCity = dCity;
    }

    public Date getTime() {
        return time;
    }

    public void setTime(Date time) {
        this.time = time;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public double getDisCount() {
        return disCount;
    }

    public void setDisCount(double disCount) {
        this.disCount = disCount;
    }

    /**
     * 带参构造
     * @param aNo
     * @param fCity
     * @param dCity
     * @param time
     * @param price
     * @param disCount
     */
    public Flight(String aNo, String fCity, String dCity, Date time, double price, double disCount) {
        this.aNo = aNo;
        this.fCity = fCity;
        this.dCity = dCity;
        this.time = time;
        this.price = price;
        this.disCount = disCount;
    }

    /**
     * 显示打印方法
     */
    public void print(){
        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
        String date = dateFormat.format(time);
        System.out.println(fCity+"\t\t"+dCity+"\t\t"+date+"\t"+"￥"+price+"\t"+disCount+"%");
    }
}
